const request = require('../../utils/request.js');
/**
 * @description 头条新闻详情
 * @param {string}  item_id  -  item_id
 */
module.exports = (req, res) => {
  const itemId = req.query.item_id || '6424603234748334594';
  const host = 'm.toutiao.com';
  const path = `/i${itemId}/info/`;
  request
    .httpGet({ host, path, status: true })
    .then(function (body) {
      res.api_success(JSON.parse(body).data);
    })
    .catch(function (err) {
      res.api_error('网络好像有点问题', 500);
      console.log(err);
    });
};
